exports.inviteContent = function(req,res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;
    //最终结果
    var resultData = {};

    var skip = restfulParams.skip == undefined ? 0 : restfulParams.skip;

    var limit = restfulParams.limit == undefined ? config.publicConfig.LIMIT : restfulParams.limit;
    //任务流创建
    async.waterfall([
        //获取文章
        function(cb){

            R.SEND_HTTP(
                req,
                {
                    // url    : CORE_APIConfig.coreAPI.search_invite_content+"/fic_invited_type/1/fic_buid/"+ restfulParams.fic_buid + "/fc_fcid/"+restfulParams.cid + "/skip/" + skip + "/limit/" + limit,
                    url    : CORE_APIConfig.coreAPI.search_invite_content+"/fic_invited_type/"+restfulParams.fic_invited_type+"/fic_buid/"+ restfulParams.fic_buid  + "/skip/" + skip + "/limit/" + limit,
                    method : 'POST',
                    data:{
                        fields:[
                            "fic_id",
                            "fic_buid",
                            "fc_id",
                            "fc_content",
                            "fc_title",
                            "fc_images",
                            "fc_collect_count",
                            "fc_answer_count"
                        ].join(",")
                    }
                },

                function (err, data) {
                    if(err){
                       return RES.response(res,true,err);
                    }

                    resultData.inviteContentData = data.data ;

                    cb();
                }
            );
        },
        function(cb){

            var tasks = [];

            resultData.inviteContentData.forEach(function (item, i) {
                ////console.log(item.fic_id);
                tasks.push(function (cb) {
                    R.SEND_HTTP(
                        req,
                        {
                            url: CORE_APIConfig.coreAPI.search_invite_log + "/fil_fid/" + item.fic_buid,
                            method: 'POST',
                            data: {
                                fields: [
                                    "u_header_url",
                                    "u_nickname",
                                    // "fil_ficid"
                                ].join(",")
                            }
                        },
                        function (err, data) {
                            if(err){
                                //console.log(err);
                            }
                            var inviteData = data.data;
                            // //console.log(inviteData);
                            item.userInfo = inviteData;
                            cb();
                        }
                    );

                })
            });
            async.waterfall(tasks, cb);
        },
    ],function(err, result){

        //返回最终拼接结果
        RES.response(res,true,resultData);

    });

}